package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-10
**/
@Entity
@Data
@Table(name="sy_logistics")
public class Logistics implements Serializable {
    /**
    * 系统订单号
    */
    @ApiModelProperty(value = "系统订单号")
    @Id
    @Column(name = "`order_no`")
    private String orderNo;
    /**
    * 标题
    */
    @ApiModelProperty(value = "标题")
    @Column(name = "`title`",nullable = false)
    @NotBlank
    private String title;
    /**
    * 快递运单号
    */
    @ApiModelProperty(value = "快递运单号")
    @Column(name = "`no`",nullable = false)
    @NotBlank
    private String no;
    /**
    * 用户id
    */
    @ApiModelProperty(value = "用户id")
    @Column(name = "`userid`")
    private Integer userid;
    /**
    * 创建时间
    */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "`cratetime`")
    private Integer cratetime;
    /**
    * 更新时间
    */
    @ApiModelProperty(value = "更新时间")
    @Column(name = "`updatetime`")
    private Integer updatetime;
    /**
    * 收货地
    */
    @ApiModelProperty(value = "收货地")
    @Column(name = "`address`")
    private String address;
    /**
    * 用户名 提示用
    */
    @ApiModelProperty(value = "用户名 提示用")
    @Column(name = "`username`")
    private String username;
    /**
    * 说明
    */
    @ApiModelProperty(value = "说明")
    @Column(name = "`remark`")
    private String remark;
    /**
    * 订单状态
    */
    @ApiModelProperty(value = "订单状态")
    @Column(name = "`status`")
    private Integer status;

    public void copy(Logistics source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
